'use strict';
(function() {

    ngApp.config(function($httpProvider) {

        $httpProvider.defaults.headers.post = { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'};
        $httpProvider.defaults.transformRequest = function(data) {
            if (data === undefined) {
                return data;
            }
            return $.param(data);
        };
        
        var defaultCall = $httpProvider.defaults.transformResponse[0];
        $httpProvider.defaults.transformResponse = function(data, headers) {
//            if (typeof(data) == "string") {
//            	if(data.indexOf("<html>") > 0 && data.indexOf("login_bg") > 0) {
//            		return {status:-1, msg:"当前页面需要用户权限才能访问，<br>请先登录！"};
//            	}
//            }
            return defaultCall(data, headers);
        };
    });
    
})();
